#ifndef SCOUT_H
#define SCOUT_H

#include <iostream>

#include "aerial\FlyObject.h"

#include "hge\hge.h"
#include "hge\hgesprite.h"
#include "hge\hgevector.h"
#include "hge\hgeresource.h"

using namespace air;
using namespace std;

/// @brief Another type of aircraft
class Scout : public IObject 
{
	enum BoostState { Normal, Boosting, Cooling };
	enum FlyState { Stopped, StartFly, Flying, StopFly };
public:
	Scout(hgeResourceManager* hgeResMan, HGE* hge, float _x, float _y);
	~Scout();
	void render();
	bool update(float dt);
	
	void boostOn();
	void boostOff();
	void mirageOn();
	void mirageOff();

	/// @brief Rotate head to (_x, _y).
	void headTo(int _x, int _y);
	/// @brief Fly heading to (_x, _y).
	void fly(int _x, int _y);
	void flyOff();

	/// @brief In millisecond
	float boostTimeLimit;
	float boostRate;
	float mirageTimeLimit;
	float speedLimit;
	float x, y;
private:
	hgeSprite* body;

	/// @brief Timer for either boosting or cooling
	float boostTimer;
	BoostState boostState;

	float mirageTimer;
	bool isMirage;

	FlyState flyState;

	float rot;
	float rotDelta;
	bool rotCW;

	float speed;
	float dx, dy;
};

#endif /* SCOUT_H */
